<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libconfini: Rationale</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libconfini
   </div>
   <div id="projectbrief">Yet another INI parser</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">Rationale </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Why <b>libconfini</b>?</p>
<p><a class="anchor" id="md_dev_docs_rationale"></a></p>
<p>The birth of <b>libconfini</b> comes from the observation that many system applications in GNU/Linux rely on <em>INI-like</em> files (systemd, pacman, network-manager, etc.), and for many users who approach GNU/Linux for the first time it could be frustrating not to have a GUI for configuring their system. So, I thought, a general .conf/.ini editor for GNOME <em>in dconf-style</em> had to be done.</p>
<p>One obstacle to a GUI editor for configuration files is that these often contain commented suggestions on how to write key/values pairs, what the default values are, etc.; and these suggestions can make a clear sense while editing a plain text, but normally disappear when the text is parsed by some application. So, eventually, an editor would need to be able not to loose the comments, and should also recognize among the comments a disabled (commented out) key or an entire disabled section, and be flexible enough to support the numerous INI dialects that exist out in the wild (multiline INI files, support for single/double quotes, different delimiter symbols, section nesting, etc.).</p>
<p>With this in mind I wrote down the first algorithms for doing the job. As I said, it was the project of an INI editor for GNOME (now abandoned)... But I love the free software paradise, and as soon as I had a set of functions able to do one single job (i.e., parsing INI files), I thought it would be nice to release them as an independent library.</p>
<p>Here is where <b>libconfini</b> comes.</p>
<p>It can be synthetized as a smart parser able to allow a complete lossless analysis and parsing of many different types of INI files, but <em>K.I.S.S.</em> enough to not store any parsed data, but rather dispatch it (well formatted) to a custom listener. It was born for an editor (which per se needs to read <em>every</em> information out of a jungle of different types of INI file), but it is usable by any application that needs to read INI files but does not need to read commented INI lines. And if a program needs to parse INI files that belong to other programs <b>libconfini</b> is definitely <a href="https://github.com/madmurphy/libconfini/wiki/INI-formats">the perfect tool</a> for the job.</p>
<p>Despite being highly configurable and flexible, this library is still a small piece of work. I honestly don't know if it will be useful to the community. I definitely do know one thing though: <b>libconfini</b> is unique in its field. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
